<template>
	<view>
		<view class="u-p-40 u-p-r-20 u-bg-white">
			<view class="u-flex user-box u-col-top">
				<view class="u-m-r-30"><u-image height="150" width="150" shape="circle" :src="zone.image"></u-image></view>
				<view class="u-flex-1">
					<view class="u-font-28 u-p-b-20 u-p-t-10" v-text="zone.name"></view>
					<view class="u-font-24 u-content-color" v-text="zone.intro"></view>
				</view>
			</view>
			<view class="">
				<view class="u-flex u-text-center u-m-t-50">
					<view class="u-flex-6">
						<u-button hover-class="none"
							type="primary"
							size="mini"
							:custom-style="{ width: '80%', height: '60rpx', backgroundColor: theme.bgColor, color: theme.color }"
							@click="openPage(1)"
						>
							<u-icon name="chat"></u-icon>
							<text class="u-m-l-10">创建问题</text>
						</u-button>
					</view>
					<view class="u-flex-6">
						<u-button hover-class="none"
							type="warning"
							size="mini"
							:custom-style="{ width: '80%', height: '60rpx', backgroundColor: theme.lightColor, color: theme.bgColor, border: '1px solid ' + theme.faBorderColor }"
							@click="openPage(0)"
						>
							<u-icon name="edit-pen-fill"></u-icon>
							<text class="u-m-l-10">发布文章</text>
						</u-button>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
export default {
	name: 'fa-zone-header',
	props: {
		zone: {
			type: Object,
			default: {}
		}
	},
	data() {
		return {};
	},
	methods: {
		openPage(index) {
			let p = [{ path: '/pages/community/article/post', query: { zone_id: this.zone.id } }, { path: '/pages/community/question/post', query: { zone_id: this.zone.id } }];
			this.$wanlshop.to(p[index].path);
		},
		sendMsg() {
			this.$emit('send');
		}
	}
};
</script>

<style></style>
